﻿using System;


namespace DotBlog.MvvmTools
{
    /// <summary>
    /// Defines a special attribute for computed field in an ObservableObject (Mvvm Light)
    /// </summary>
    [AttributeUsage(AttributeTargets.Property,AllowMultiple = false, Inherited = false)]
    public class ComputedFieldAttribute : Attribute
    {
        public ComputedFieldAttribute(string[] triggerFields)
        {
            TriggerFields = triggerFields;
        }

        /// <summary>
        /// List of all fields that must trigger an INPC for the given property using this attribute.
        /// Names are unfortunately given as string so take care when renamming properties...
        /// </summary>
        public string[] TriggerFields { get; set; }
    }
}
